1. Field of the Invention
Embodiments of the present invention relate generally to mass storage systems and, more specifically, to media protection notification for serial interface mass storage devices.
2. Description of the Related Art
Modern computer systems commonly include a mass storage device, such as a hard disk drive, that is used to store operating system images, application programs and user data. Hard disk drives are electromechanical devices that include one or more disk-shaped platters used to store data in concentric tracks on a magnetically readable and writeable surface. Each hard disk drive typically has an actuator that positions a set of one or more read/write heads above a selected track. The spinning motion of the disk allows the read/write head to access any data stored on the selected track by “flying” above the track until the desired data passes under the read/write head. In normal use, the read/write head is continually positioned above the platter, providing constant read/write access to the data stored thereon. However, if the hard disk drive is subjected to a mechanical shock (a “high-g” event) while the read/write head is positioned above the spinning platter, damage may occur to the hard disk drive. Such damage may range in severity from minor surface damage and localized loss of data through a catastrophic head failure that renders the hard disk drive inoperable. Hard disk drives that are used within mobile computing devices, such as laptop computers and personal digital assistants (PDAs), are especially prone to mechanical shock damage from high-g events because the whole mobile computing device spends a great deal of time being carried about, which places the entire device at risk.
Fortunately, hard disk drives are significantly less susceptible to damage when the read/write head is safely positioned away from the spinning platter in a state referred to as “parked.” In order to exploit a more robust parked state, the hard disk drive needs to be able to transition from an active state to the parked state before an impact occurs. AT attachment (ATA) hard disk drives include a transport layer command, referred to as “IDLE IMMEDIATE,” that attempts to idle the hard disk drive as quickly as possible when a high-g event occurs. The hope in using the IDLE IMMEDIATE command is that hard disk drive may be able to park the read/write heads before impact. The IDLE IMMEDIATE command parks the read/write heads and aborts any ATA commands that are in progress.
Current generation ATA drives use a serial link interface, referred to as serial ATA (SATA). The SATA interface uses two high-speed serial links to communicate with a host controller. ATA commands are encapsulated within sequential frames of serial data that are transmitted over the first of the two serial links. The second serial link carries data transmitted from the hard disk drive back to the host controller. The SATA standard uses a well-known physical link layer protocol, known as “8b/10b” that encodes eight bits of payload using ten bits of transmitted code. Thus, a SATA hard disk drive may receive a transport layer IDLE IMMEDIATE command over the first serial link and respond by parking the read/write heads and aborting any ATA commands that are in progress.
One approach to averting damage from a high-g event involves using a multi-axis accelerometer, such as a three-axis accelerometer, to sense a transition to zero-gravity (free fall) or a transition to high-gravity about an axis (spinning fall) and then to notify management software within the computing device to issue an IDLE IMMEDIATE command to any spinning hard disk drives. For example, when a laptop flips over the edge of a desk, the accelerometer detects a likely high-g event from a spinning fall and the accelerometer generates a notification to management software within the computing device. In response, the management software issues an IDLE IMMEDIATE command to the hard disk drive over the SATA physical link, causing the hard disk drive to abort any pending commands and to park the read/write heads as soon as possible. If the computing device is falling far enough to allow the accelerometer notification enough time to travel through the notification software path to the SATA host controller and then to the hard disk drive, the hard disk drive may be able to park its read/write heads in time. After issuing the IDLE IMMEDIATE command, the management software initiates a recovery process whereby aborted commands are discovered and re-issued before processing continues.
One drawback of the current solution is that the IDLE IMMEDIATE command is issued in sequence with other transport layer commands and, therefore, must wait for the current ATA transport layer command to complete before being transmitted to the hard disk drive over the SATA serial link. If the current ATA transport layer command involves transmitting a large block of data, a significant time delay may be introduced between the time software generates the IDLE IMMEDIATE command and when the hard disk drive actually receives the command. Additional delay is introduced in the software path leading from the accelerometer notification to the actual generation of the IDLE IMMEDIATE command. The substantial delay from when the accelerometer senses a possible high-g event to when the hard disk drive is actually able to act on this information through the IDLE IMMEDIATE command decreases the probability that the hard disk drive will be able to remove the read/write heads in time to avoid data loss. A second drawback of the current solution is the inefficiency and additional processing complexity imposed by aborting ATA commands that are already in progress. While the process of aborting ATA commands typically does not lead to user data loss in a properly functioning system, the process of recovering from aborted ATA commands can be time consuming and represents significant implementation and processing complexity.
As the foregoing illustrates, what is needed in the art is a mechanism to remove the read/write heads from disk media more quickly and with less processing disruption when the conditions leading to a high-g event are detected.